#!/bin/bash
DATABASE_NAME='osdal'
DATABASE_USER='osdal'
DATABASE_PASSWORD='ocean'

function SqlDumpData {
	mysqldump -u $DATABASE_USER -p$DATABASE_PASSWORD --no-create-info --skip-opt --comments=0 $1 | \
	egrep -v "INSERT INTO \`(accesslog|cache|search_index|sessions)\`" | sort >$2
}
  
function SqlDumpStructure {
	mysqldump -u $DATABASE_USER -p$DATABASE_PASSWORD --no-data $1 >$2
}
  
  
SqlDumpData $DATABASE_NAME osdal_data.sql
SqlDumpStructure $DATABASE_NAME osdal_structure.sql
  
